package com.hb.core.base;

import com.hb.core.constant.Constants;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @description:
 * @projectName: zhb-frame-build
 * @author: zhouhaizhi
 * @createTime: 2021/8/16 14:01
 * @version:1.0
 */
@Data
@AllArgsConstructor
public class OrderField {

    private String fieldName;

    private String sort;

    public boolean isAsc() {
        return Constants.SORT_ASC.equals(this.sort);
    }

    public boolean isDesc() {
        return Constants.SORT_DESC.equals(this.sort);
    }

    @Override
    public String toString() {
        return "OrderField{" +
                "fieldName='" + fieldName + '\'' +
                ", sort='" + sort + '\'' +
                '}';
    }
}
